package com.Daisy.swi.client.model;

import java.util.ArrayList;

public abstract class DataModel {
	protected ArrayList<ModelListener> listeners = new ArrayList<ModelListener>();
	
	public void register(ModelListener listener) {
		this.listeners.add(listener);
	}
	
	public void unregister(ModelListener listener) {
		this.listeners.remove(listener);
	}
	
	protected void updateData() {
		for (ModelListener l: listeners) {
			l.onDataUpdate();
		}
	}
}
